package com.wzh.house.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.wzh.common.utils.PageUtils;
import com.wzh.common.utils.Query;

import com.wzh.house.dao.HouseAttrValueDao;
import com.wzh.house.entity.HouseAttrValueEntity;
import com.wzh.house.service.HouseAttrValueService;


@Service("houseAttrValueService")
public class HouseAttrValueServiceImpl extends ServiceImpl<HouseAttrValueDao, HouseAttrValueEntity> implements HouseAttrValueService {

    @Autowired
    private HouseAttrValueDao attrValueDao;

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<HouseAttrValueEntity> page = this.page(
                new Query<HouseAttrValueEntity>().getPage(params),
                new QueryWrapper<HouseAttrValueEntity>()
        );

        return new PageUtils(page);
    }

    @Override
    public HouseAttrValueEntity getOneByHouseId(Integer houseId) {
        return baseMapper.selectOne(new QueryWrapper<HouseAttrValueEntity>().eq("house_id",houseId));
    }

    @Override
    public void removeByHouseIds(Integer[] houseIds) {
        attrValueDao.removeByHouseIds(houseIds);
    }

}